<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>登录</title>
  </head>
  <body>
  <h2>物业管理系统登录</h2>

  <!-- 登录表单 -->
  <form action="/UsersServlet?method=login" method="post">
    <div>
      <label for="username">用户名称:</label>
      <input type="text" id="username" name="uname" required>
    </div>
    <div>
      <label for="password">用户密码:</label>
      <input type="password" id="password" name="upwd" required>
    </div>
    <div>
      <input type="submit" value="登录">
    </div>
  </form>

  <!-- 显示错误消息 -->
  <%
    String message = (String) request.getSession().getAttribute("msg");
    if (message != null) {
  %>
  <p style="color: red;"><%= message %></p>
  <%
    }
  %>

  <!-- 注册链接 -->
  <p><a href="register.jsp">注册</a></p>
  </body>
</html>
